/**
 * 
 */
package com.example.zhongshuishi.taxs_api;

import java.io.UnsupportedEncodingException;

import com.alibaba.fastjson.JSONObject;

/**
 * @author hellozhihua
 * 
 * 
 * 
 * @税控接口服务调用DEMO
 * 
 * 
 */
public class TaxsApiDemo {

	public static void main(String[] args) throws UnsupportedEncodingException {

        testMode();
		//registApp();
	}

	public static void testMode(){
		String json = "{\n" +
				"    \"async\": \"true\",\n" +
				"\t\"mock\":\"true\",\n" +
				"    \"input\": {\n" +
				"        \"ghdwdz\": \"石景山\",\n" +
				"        \"ghdwmc\": \"中税师北京信息咨询中心\",\n" +
				"        \"kplx\": \"0\",\n" +
				"        \"hjse\": \"1\",\n" +
				"        \"ghdwyh\": \"农业银行\",\n" +
				"        \"ghdwzh\": \"6339490678892341472\",\n" +
				"        \"xhdwdh\": \"010-68814900\",\n" +
				"        \"mx\": [{\n" +
				"            \"xh\": \"1\",\n" +
				"            \"fphxz\": \"0\",\n" +
				"            \"hsbz\": \"0\",\n" +
				"            \"se\": \"1.55\",\n" +
				"            \"yhzcbs\": \"0\",\n" +
				"            \"spmc\": \"平台服务费\",\n" +
				"            \"sl\": \"0.06\",\n" +
				"            \"je\": \"1\",\n" +
				"            \"spbm\": \"3040205000000000000\"\n" +
				"        }],\n" +
				"        \"gmf_dzyx\": \"admin@124.com\",\n" +
				"        \"kpr\": \"张三\",\n" +
				"        \"hjje\": \"1\",\n" +
				"        \"ghdwdh\": \"0551-66338755\",\n" +
				"        \"fplxdm\": \"81\",\n" +
				"        \"ghdwsbh\": \"91340121715444\",\n" +
				"        \"bz\": \"\",\n" +
				"        \"gfxxconfirm\": \"0\",\n" +
				"        \"jshj\": \"1\",\n" +
				"        \"xhdwyh\": \"***支行\",\n" +
				"        \"zyspmc\": \"平台服务费\",\n" +
				"        \"tspz\": \"00\",\n" +
				"        \"xhdwzh\": \"15000102964662\"\n" +
				"    },\n" +
				"\t\"nsrsbh\": \"91110108802079937H\",\n" +
				"    \"appid\": \"18e81c37-17d4-4f0d-8ab5-6ccf874c22bf\",\n" +
				"    \"serviceid\": \"FPKJ\",\n" +
				"    \"sid\": \"8888133312\"\n" +
				"}";

		String publickey = "92N0La5}AC$@efgt";// 联系服务商提供

		String privatekey = "20f28f8b79we7dfd";// 联系服务商提供

		String url = "https://taxsapivip.holytax.com/v1/api/s";// 联系服务商提供
		//
        JSONObject ret = null;
        try {
            ret = RequestKit.request(url, publickey, privatekey, json);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }

        System.out.println(ret);
	}

	public static void registApp(){
		String json = "{\n" +
				"\"serviceid\": \"DJAPP\",\n" +
				"\"dev_key\": \"71ad6db7-19b7-4d51-b11d-4213737bf161\",\n" +
				"\"app_name\": \"网络主播合规网\",\n" +
				"\"dqbm\": \"beijing\",\n" +
				"\"djlx\": \"QD\",\n" +
				"\"devType\": \"0\",\n" +
				"\"bsryxm\": \"朱文红\",\n" +
				"\"dlsf\": \"3\",\n" +
				"\"dlsfmm\": \"ZSS@158168\",\n" +
				"\"dlfs\": \"2\",\n" +
				"\"dlmm\": \"ZSS@158168\",\n" +
				"\"dlzh\": \"13260447547\",\n" +
				"\"nsrmc\": \"中税师（北京）税务咨询中心\",\n" +
				"\"nsrsbh\": \"91110108802079937H\",\n" +
				"\"bsrysfzjhm\": \"652301197108225525\",\n" +
				"\"bsrysjhm\": \"13260447547\",\n" +
				"\"zjh\": \"13260447547\",\n" +
				"\"loginType \": \"1\",\n" +
				"\"deviceType\": \"\",\n" +
				"\"keypwd\": \"\",\n" +
				"}";

		String publickey = "92N0La5}AC$@efgt";// 联系服务商提供

		String privatekey = "20f28f8b79we7dfd";// 联系服务商提供

		String url = "https://taxsapivip.holytax.com/v1/api/s";// 联系服务商提供
		//
        JSONObject ret = null;
        try {
            ret = RequestKit.request(url, publickey, privatekey, json);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }

        System.out.println(ret);
	}

}
